package zjh_20230316;

public class Demo03 {
    public static void main(String[] args) {
        String str = "abcdef";
        char[] arrNew= new char[str.length()];
        for (int i = 0; i < str.length(); i++) {
            arrNew[i] = str.charAt(i);
        }

//        Integer.rotateLeft(0,2);
        for (int i = 0; i < 2; i++) {
            char c = arrNew [i];
            arrNew[i] = arrNew[str.length() - i - 1];
             arrNew[str.length() -i - 1] = c;
        }
        for (int i = 0; i < str.length(); i++) {
            System.out.print(arrNew[i]);
        }

    }
}
